package com.xxx.map;

import java.util.Hashtable;
import java.util.Iterator;
import java.util.Set;

/**
 * @version v1.0
 * @Description:
 * @Author zhanzhongxin
 * @Date 2021/7/22 9:15
 * @Copyright 博为峰
 */
public class HashtableDemo {
    public static void main(String[] args) {
        Hashtable<String, String> hashtable = new Hashtable<>();
        hashtable.put("张三", "北京");
        hashtable.put("李四", "上海");
        hashtable.put("王五", "广州");
        hashtable.put("赵六", "深圳");
        Set<String> set = hashtable.keySet();
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
